$(function () {
    var oldind =0;
    var liindex =0;
    var arrTemp =[30,110,230,350,470,550,630];
    $('#topmenu li').on('mouseover',function () {
        liindex = $(this).index();
        var left=arrTemp[liindex];
        var width =$('#topmenu li').eq(liindex).width();
        $('.bottombar').animate({left:left,width:width},50);
    });
    $('#topmenu .menu').mouseleave(function () {
        var left=arrTemp[oldind];
        var width = $('#topmenu li').eq(oldind).width();
        $('.bottombar').animate({left:left,width:width},50);
    });

    $("#topmenu .menu li").eq(0).find("a").mouseover(function(){$(".memuTr").css("display","none");$(".memuTr_blue").css("display","none");});
    $("#topmenu .menu li").eq(1).find("a").mouseover(function(){
        $(".memuTr").css("display","block");$(".memuTr_blue").css("display","none");
    });
    $("#topmenu .menu li").eq(2).find("a").mouseover(function(){$(".memuTr").css("display","none");$(".memuTr_blue").css("display","none");});
    $("#topmenu .menu li").eq(3).find("a").mouseover(function(){$(".memuTr").css("display","none");$(".memuTr_blue").css("display","block");});
    $("#topmenu .menu li").eq(4).find("a").mouseover(function(){$(".memuTr").css("display","none");$(".memuTr_blue").css("display","none");});
    $("#topmenu .menu li").eq(5).find("a").mouseover(function(){$(".memuTr").css("display","none");$(".memuTr_blue").css("display","none");});
    $("#topmenu .menu li").eq(6).find("a").mouseover(function(){$(".memuTr").css("display","none");$(".memuTr_blue").css("display","none");});

    $(".memuTr").mouseover(function(){$(".memuThree").css("display","block")
        var left=arrTemp[liindex];var width =$('#menu li').eq(liindex).width();
        $('.bottombar').animate({left:left,width:width},1);})
    $(".memuTr").mouseleave(function(){$(".memuTr").css("display","none")
        var left=arrTemp[oldind];var width =$('#menu li').eq(oldind).width();
        $('.bottombar').animate({left:left,width:width},1);})
    $(".memuTr_blue").mouseover(function(){$(".memuTr_blue").css("display","block")
        var left=arrTemp[liindex];var width =$('#menu li').eq(liindex).width();
        $('.bottombar').animate({left:left,width:width},1);})
    $(".memuTr_blue").mouseleave(function(){$(".memuTr_blue").css("display","none")
        var left=arrTemp[oldind];var width =$('#menu li').eq(oldind).width();
        $('.bottombar').animate({left:left,width:width},1);})
});